import AdminLayout from '@/admin/Layout.vue'
import MyMainLayout from '@/views/Layout/MyMainLayout.vue';
import AuthLayout from '@/views/Pages/AuthLayout.vue';
import NotFound from '@/views/NotFoundPage.vue';

const routes = [
  {
    path: '/',
    redirect: 'home',
    component: MyMainLayout,
    children: [
      {
        path: '/home',
        name: '系统首页',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import(/* webpackChunkName: "demo" */ '../views/Dashboard.vue')
      },
      {
        path: '/onCampus',
        name: '校内选课',
        component: () => import(/* webpackChunkName: "demo" */ '../views/OnCampusCourseSelection.vue')
      },
      {
        path: '/online',
        name: '线上选课',
        component: () => import(/* webpackChunkName: "demo" */ '../views/OnlineCourseSelection.vue')
      },
      {
        path: '/classtable',
        name: '选课管理',
        component: () => import(/* webpackChunkName: "demo" */ '../views/ClassTable.vue')
      },
      {
        path: '/profile',
        name: '个人信息',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/UserProfile.vue')
      },
      {
        path: '/timetable',
        name: '个人课表',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Timetable.vue')
      },
      {
        path: '/findExam',
        name: '考试查询',
        component: () => import(/* webpackChunkName: "demo" */ '../views/FindExam.vue')
      },
      {
        path: '/findScore',
        name: '成绩查询',
        component: () => import(/* webpackChunkName: "demo" */ '../views/FindScore.vue')
      },
      {
        path: '/activityRegistration',
        name: '活动报名',
        component: () => import(/* webpackChunkName: "demo" */ '../views/ActivityRegistration.vue')
      },
      {
        path: '/evaluation',
        name: '教学质量评价',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Evaluation.vue')
      },

      {
        path: '/account',
        name: '修改密码',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Account.vue')
      },
      {
        path: '/icons',
        name: 'icons',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Icons.vue')
      },
    ]
  },
  {
    path: '/test',
    name: 'test',
    component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/test.vue')
  },
  {
    path: '/test2',
    name: 'test2',
    component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/test2.vue')
  },
  {
    path: '/',
    redirect: 'login',
    component: AuthLayout,
    children: [
      {
        path: '/login',
        name: 'login',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/Login.vue')
      },
      {
        path: '/register',
        name: 'register',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/Register.vue')
      },
      {
        path: '/bindAccount',
        name: 'bindAccount',
        component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/BindAccount.vue')
      },
    ]
  },
  {
    path: '/',
    redirect: 'adminMain',
    component: AdminLayout,
    children: [
      {
        path: '/chargeUser',
        name: '管理用户',
        component: () => import(/* webpackChunkName: "demo" */ '../admin/ChargeUser.vue')
      },
      {
        path: '/chargeVenue',
        name: '管理场地',
        component: () => import(/* webpackChunkName: "demo" */ '../admin/ChargeVenue.vue')
      },
      { path: '*', component: NotFound }
    ]
  }
];

export default routes;
